package org.zjvis.datascience.common.util;


import java.util.Properties;

/**
 * @author AaronY
 * @version 1.0
 * @since 2022/6/1
 */
public class PropertiesHelper {

    public static Properties loadFromString(String str){
        String[] parts = str.split(";");
        Properties properties = new Properties();
        for (String part: parts){
            properties.put(part.split("=")[0], part.split("=")[1]);
        }
        return properties;
    }

    public static void main(String[] args) {
        String s = "druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000";
        Properties properties = PropertiesHelper.loadFromString(s);
        System.out.println(properties);
    }
}
